package com.github.ecbp.user.service.api;

import com.github.ecbp.common.req.BaseIdDTO;
import com.github.ecbp.common.req.BaseIdListDTO;
import com.github.ecbp.user.service.response.AdminWithPermissionRes;
import com.github.ecbp.user.service.response.MenuRes;
import com.github.ecbp.user.service.response.PermissionRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

import static com.github.ecbp.common.constant.CacheKeyConstant.FEIGN_VERSION;


@Api(tags = "权限API")
@RequestMapping("/apis/" + FEIGN_VERSION + "/permission")
public interface PermissionApi {

    @ApiOperation(value = "通过菜单获得对应权限", notes = "zhangj")
    @PostMapping("/getPermissionByMenuId")
    List<PermissionRes> getPermissionVoByMenuId(BaseIdListDTO param);

    @ApiOperation(value = "通过权限ID获得对应权限", notes = "zhangj")
    @PostMapping("/getPermissionVoById")
    List<PermissionRes> getPermissionVoById(BaseIdListDTO param);

    @ApiOperation(value = "通过权限获得对应菜单", notes = "zhangj")
    @PostMapping("/getMenuVoByPermissionId")
    List<MenuRes> getMenuVoByPermissionId(BaseIdListDTO param);

    @ApiOperation(value = "通过菜单ID获得对应菜单", notes = "zhangj")
    @PostMapping("/getMenuVoById")
    List<MenuRes> getMenuVoById(BaseIdListDTO param);

    @ApiOperation(value = "获得所有菜单", notes = "zhangj")
    @PostMapping("/getAllMenuVo")
    List<MenuRes> getAllMenuVo();

    @ApiOperation(value = "获得指定用户的所有权限", notes = "zhangj")
    @PostMapping("/getPermissionList")
    AdminWithPermissionRes getPermissionList(BaseIdDTO param);

    @ApiOperation(value = "获得指定用户的所有权限", notes = "zhangj")
    @PostMapping("/getMenuList")
    List<MenuRes> getMenuList(BaseIdDTO param);
}
